﻿using System.Configuration;
using Atom.Common.ResourceProvider;

namespace Atom.Common.Configuration
{
    public class DbResourceProviderConfigurationElement : ResourceProviderConfigurationElement
    {
        [ConfigurationProperty("connectionStringName", IsRequired = true)]
        public string ConnectionStringName
        {
            get
            {
                return (string)this["connectionStringName"];
            }
            set
            {
                this["connectionStringName"] = value;
            }
        }

        public override IResourceProvider CreateProvider()
        {
            return new DbResourceProvider(this.ConnectionStringName);
        }
        
    }
}
